package com.jiai.cloud.feign;

import com.jiai.cloud.entity.TPageModule;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import static org.springframework.web.bind.annotation.RequestMethod.GET;
import static org.springframework.web.bind.annotation.RequestMethod.POST;
/**
 * Created by Administrator on 2017/5/27.
 */
@FeignClient("authentication")
public interface PageModuleAPI {

    //增
    @RequestMapping(value="/api/v1/pageModule/addPage", produces = {"application/json;charset=UTF-8"}, method = POST)
    Object addPageModule(@RequestBody TPageModule tPageModule);

    //删
    @RequestMapping(value="/api/v1/pageModule/delete/{id}", produces = {"application/json;charset=UTF-8"}, method = POST)
    Object delete(@PathVariable("id") Integer id);

    //查所有
    @RequestMapping(value = "/api/v1/pageModule/findByAll/{page}", produces = {"application/json;charset=UTF-8"},method = GET)
    Object selectPage(@PathVariable("page") Integer page);

    //ID查
    @RequestMapping(value = "/api/v1/page/findById/{id}", produces = {"application/json;charset=UTF-8"},method = GET)
    Object selectById(@PathVariable("id") Integer id);

    //改(有就改，没有就插入)
    @RequestMapping(value="/api/v1/pageModule/edit", produces = {"application/json;charset=UTF-8"}, method = POST)
    @ResponseBody
    Object edit(TPageModule tPageModule);
}
